#include <stdio.h>
#include "ofc/DImageHeader.h"
#include "ofc/DFile.h"

int main(int argc, char *argv[])
{
  DImageHeader *hdr  = [DImageHeader new];
  DFile        *file = [DFile new];

  if ([file open :"example.jpg" :"r"])
  {
    if ([hdr inspect :file])
      printf("File type:%d Mime Type:%s File Extension:%s\n", [hdr type], [hdr mime_type], [hdr extension]);
    else
      printf("No image type could be detected for file \"example.jpg\".\n");

    [file close];
  }
  else
    printf("File \"example.jpg\" could not be opened for inspection.\n");

  [file free];                         // Cleanup
  [hdr  free];

  return 0;
}

